
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class MainMenu extends JMenuBar implements ActionListener
{
	JMenuItem humanHuman;
	JMenuItem exit;


	public MainMenu()
	{
		super();
		setBackground(new Color(70, 184, 38));
		setPreferredSize(new Dimension(200, 20));

		JMenu file = new JMenu("File");
		JMenu New = new JMenu("New");
		JMenuItem humanRobot = new JMenuItem("Human vs Robot");
		humanHuman = new JMenuItem("Human vs Human");
		New.add(humanRobot);
		New.add(humanHuman);
		exit = new JMenuItem("Exit");
		file.add(New);
		file.add(exit);
		exit.addActionListener(this);
		humanHuman.addActionListener(this);

		JMenu help = new JMenu("Help");
		add(file);
		add(help);

	}

	public void actionPerformed(ActionEvent e)
	{
		if(e.getSource() == exit)
		{
			System.exit(0);
		}
	}
}
